<?php
namespace app\admin\controller;

class Documents extends Admin{


    public function index(){
        $Documents = M('Documents');
        $count = $Documents->count();
        import('@.util.Page');
        $Page = new \Page($count,15);
        $list = $Documents->field('content',true)->where($map)->limit($Page->limit)->order('sort desc,id desc')->select();
        return $this->fetch('index',[
            'list'=>$list,
            'page' => $Page -> pageShow(),
        ]);
    }

    public function create(){
        if(IS_POST){

        }else{
            //获取所有分类
            $Sorting = M('sorting');
            $list = $Sorting->where('pid=0')->order('sort desc')->select();
            return $this->fetch('create',['sort'=>$list]);
        }
    }

    public function update(){

    }

    public function delete(){

    }

    public function show(){

    }
}
